﻿using Prism.Commands;
using Prism.Mvvm;
using Prism.Navigation.Regions;
using System;

namespace WPFBlankPrism.ViewModels
{
    public class MainWindowViewModel : BindableBase
    {
        IRegionManager _regionManager;
        public DelegateCommand<string> OpenCommand { get; set; }
        public MainWindowViewModel(IRegionManager regionManager)
        {
            _regionManager = regionManager;
            OpenCommand = new DelegateCommand<string>(Execute);
        }

        private void Execute(string obj)
        {
            _regionManager.Regions["ContentRegion"].RequestNavigate(obj);
        }
    }
}
